package org.example.controller.pojo;

import java.util.LinkedList;
import java.util.List;

public class MenuItem {
    private int id;
    private String title;
    private List<MenuItem> subitems;

    public MenuItem(int id, String title) {
        this.id = id;
        this.title = title;
        this.subitems = new LinkedList<>();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<MenuItem> getSubitems() {
        return subitems;
    }

    public void setSubitems(List<MenuItem> subitems) {
        this.subitems = subitems;
    }

    public void addSubitem(MenuItem item) {
        subitems.add(item);
    }
}
